package ExamLab.Test2;

class HighTop extends Thread{

    public void run(){
         staticMethod();
    }	

    public static synchronized void staticMethod(){
         for(int i=0;i<5;i++){
              System.out.print(" A"+i);
         }
    }

}


public class LowTop extends HighTop{

    public void run(){
         staticMethod();
    }

    public static synchronized void staticMethod(){
         for(int i=0;i<5;i++){
              System.out.print(" B"+i);
         }
    }

    public static void main(String args[]){
         HighTop t1=new HighTop();
         LowTop t2=new LowTop();	
         t2.start();
         t1.start();
    }

}